package com.sky.mapper;

import com.sky.entity.SetmealDish;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface SetmealDishMapper {


    Long[] getSetmealIdsByDishIds(Long[] dishIds);

    /**
     * 新增菜品关联套餐
     * @param setmealDishes
     */

    void insertSetmeal(List<SetmealDish> setmealDishes);

    /**
     * 查询回显
     * @param id
     * @return
     */
    @Select("select * from setmeal_dish where setmeal_id = #{id}")
    List<SetmealDish> setmealId(Long id);

    void updateSetmeal(SetmealDish dish);

    /**
     * 删除套餐关联菜品
     * @param id
     */
    @Delete("delete from setmeal_dish where setmeal_id = #{id}")
    void deleteSetmeal(Long id);
}
